<?php  
class Nota_model extends CI_Model {  

    function Nota_model()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function getData()
	{
		$DB_info = $this -> load -> database('info', TRUE);
		$DB_info -> cache_on();
		$DB_info -> select('barcode_barang, barang.kode_barang, nama_barang, warna.kode_warna, warna, kode_jenis_barang, satuan, jumlah_satuan');
		$DB_info -> from('barcode_barang');
		$DB_info -> join('barang', 'barcode_barang.kode_barang = barang.kode_barang', 'inner');
		$DB_info -> join('warna', 'barcode_barang.kode_warna = warna.kode_warna', 'inner');
		$DB_info -> order_by('nama_barang','asc');

		$query = $DB_info -> get();
		
		if($query -> num_rows() > 0)
		{
			return $query->result();
		}
		else
		{
			return show_error('Database is empty!');
		}
	}

}  
?>